package com.sea.supply.service.impl;

import com.codecrane.core.web.BatchImportUtils;
import com.sea.product.entity.Channel;
import com.sea.product.entity.Product;
import com.sea.product.mapper.ChannelMapper;
import com.sea.product.service.ProductService;
import com.sea.supply.entity.ProductPrice;
import com.sea.supply.entity.ProductPriceRecord;
import com.sea.supply.entity.Supplier;
import com.sea.supply.mapper.ProductPriceMapper;
import com.sea.supply.mapper.ProductPriceRecordMapper;
import com.sea.supply.mapper.SupplierMapper;
import com.sea.supply.service.ProductPriceRecordService;
import com.sea.supply.service.ProductPriceService;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.InputStream;
import java.util.List;

@Service
public class ProductPriceRecordServiceImpl implements ProductPriceRecordService {

    @Autowired
    private ProductPriceRecordMapper productPriceRecordMapper;

    @Override
    public List<ProductPriceRecord> findByPriceId(Integer productPriceId) {
        return productPriceRecordMapper.findByPriceId(productPriceId);
    }

    @Override
    public int insert(ProductPriceRecord productPriceRecord) {
        return productPriceRecordMapper.insert(productPriceRecord);
    }

    @Override
    public ProductPriceRecord findLastPrice(Integer productPriceId) {
        return productPriceRecordMapper.findLastPrice(productPriceId);
    }
}
